<template>
  <div class="demo-block-wrap">
    <div class="demo-block-title" v-if="title">{{ title }}:</div>
    <div class="demo-block-slot" :class="{ 'demo-block-padding': padding }">
      <slot></slot>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "demo-block",
  setup() {
    return {};
  },
  props: {
    title: String,
    padding: Boolean,
  },
});
</script>

<style lang="less">
.demo-block-wrap {
  margin-bottom: 20px;
  .demo-block-title {
    color: rgba(69, 90, 100, 0.6);
    padding-left: 10px;
    font-size: 15px;
    line-height: 2;
    margin-bottom: 5px;
  }
  .demo-block-padding {
    padding: 0 10px;
  }
  .sub-title {
    font-size: 12px;
    color: gray;
    display: block;
    margin-bottom: 5px;
  }
}
</style>
